<div class="row-content am-cf">
	<div class="row">
		<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
			<div class="widget am-cf">
				<div class="widget-head am-cf">
					<div class="widget-title am-fl">新增群组</div>
					<div class="widget-function am-fr">
						<a href="javascript:;" class="am-icon-cog"></a>
					</div>
				</div>
				<div class="widget-body am-fr">
					<form class="am-form tpl-form-line-form" id="deptForm" method="post">
						<div class="am-form-group">
							<label for="deptName" class="am-u-sm-2 am-form-label"><span class="text-red"> *</span>群组名称：
								<span class="tpl-form-line-small-title"></span>
							</label>
							<div class="am-u-sm-10">
								<input type="text" id="deptName" class="tpl-form-input" placeholder="群组名称" name="deptName"  required="required"/> 
							</div>
						</div>
						<div class="am-form-group">
							 <label for="deptDesc" class="am-u-sm-2 am-form-label">描述：
								<span class="tpl-form-line-small-title"> </span>
							</label> 
							<div class="am-u-sm-10">
							    <input type="hidden" id="id" name="id">
								<input type="text" id="deptDesc" class="tpl-form-input" placeholder="描述" name="deptDesc"  /> 
							</div>
						</div>
						

					

					

						<div class="am-form-group">
							<div class="am-u-sm-10 am-u-sm-push-2">
								
								<button type="button" onclick="javascript:$('#deptForm').submit();"
									class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
										<button type="button" onclick="loadPage('dept/listUI')"
									class="am-btn am-btn-success tpl-btn-bg-color-success ">返回</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>

	</div>
	<script th:inline="javascript">
	<![CDATA[
	$('select').selected();
	validatedeptForm();
	function validatedeptForm(){    
	    $('#deptForm').validate({
	        errorElement : 'span',
	        errorClass : 'am-icon-times',
	        focusInvalid : true,
	        onkeyup:false,
	        ignore : "",
	        rules : {
	        	deptName : {
	                required : true,
	                maxlength : 50,
	                remote:"dept/checkDeptName"
	            },
	            deptDesc : {
	            	maxlength : 50
	            }
	        },
	        messages : {
	        	deptName : {
	                required : "群组名称必填",
	               remote:"该群组名称已存在，请修改"
	            },
	        },
	        submitHandler : function(form) {
	        	commit('deptForm', 'dept/save', 'dept/listUI');
	        }
	    });
	}
		]]>
	</script>